<template>
  <div>
     <h1>父组件</h1>
     <h1>{{mysex}}</h1>
     <button @click="mysex='女'">改性别</button>
     <hr>
     <mineOne></mineOne>
     <hr>
     <mineTwo></mineTwo>
  </div>
</template>
<script>
import mineOne from './child/mineOne.vue'
import mineTwo from './child/mineTwo.vue'
export default {
   components:{mineOne,mineTwo},
   data(){
    return {
      mysex:"男"
    }
   },
  //  vue 后代组件传值 使用provide 和inject 
  // provide 传递数据 inject 在后代组件中接受数据
  provide(){
    return {
      myname:'成龙章子怡李连杰',
      myage:18,
      mysex:this.mysex
    }
   }
}
</script>